package com.yfp.client.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum WxPayAttach {
    // 支付订单类型：实体类型套餐购买，2虚拟类型套餐购买(礼包)，3储值有礼购买，商城商品购买
    ENTITY_TYPE(1, "实体类型套餐购买", "entity_type"),
    VIRTUAL_PACK_TYPE(2, "虚拟类型套餐购买(礼包)", "virtual_pack_type"),
    MALLPRODUCT_VALUE_TYPE(3, "商城商品购买", "mallproduct_value_type"),
    STORED_VALUE_TYPE(4, "储值有礼购买", "stored_value_type");

    private Integer code;
    private String desc;
    private String value;

    public static String getValue(Integer code) {
        for (WxPayAttach wxPayAttach : WxPayAttach.values()) {
            if (wxPayAttach.getCode().equals(code)) {
                return wxPayAttach.getValue();
            }
        }
        return null;
    }
}
